<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateTableGoodsExchanges extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('goods_exchanges', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->bigInteger('goods_id')->index()->comment('产品ID');
            $table->bigInteger('sku_id')->default(0)->comment('货品ID');
            $table->integer('score')->default(0)->comment('兑换所需积分');
            $table->timestamp('start_time')->nullable()->comment('开始时间');
            $table->timestamp('end_time')->nullable()->comment('结束时间');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('goods_exchanges');
    }
}
